class NavBar extends React.Component {
    render() {
        var navList=[
            {name:'词'},
            {name:'成'},
            {name:'谚'},
            {name:'英'}
        ];
        return (
            <nav className="tabbar tabbar-success padding-h-0">
                {
                    navList.map((o, i) => {
                        return (
                            <a key={i} onClick={this.props.onClick.bind(this, i)} className={'tabbar-item'+(this.props.active==i?' active':'')}>
                                <span className="tabbar-label">{o.name}</span>
                            </a>
                        )
                    })
                }
            </nav>
        )
    }
}

NavBar.propTypes={
    active:React.PropTypes.number,
    onClick:React.PropTypes.func.isRequired
};

module.exports = NavBar;